package service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mybatis.mapper.UserinfoMapper;
import com.mybatis.po.Userinfo;

@Service
public class LoginService {
	@Autowired
	private UserinfoMapper userinfoMapper;
	public boolean right(Userinfo userinfo) {
		boolean ans=false;
		String password=userinfoMapper.selectUserById(userinfo.getId());
		if(password.equals(userinfo.getPwd())) {
			ans=true;
		}else {
			ans=false;
		}
		return ans;
	}
	public String getname(String id) {
		return userinfoMapper.selectUserUnameById(id);
	}
}
